#define _CRT_SECURE_NO_WARNINGS 1

# include"Date.h"

ostream& operator<<(ostream& out, const Date& d1)
{
	out << d1._year << "/" << d1._month << "/" << d1._day << endl;
	return out;
}

istream& operator>>(istream& in, Date& d1)
{
	in >> d1._year >> d1._month >> d1._day;
	return in;
}


Date Date::operator+(int day)
{
	Date tmp = *this;
	tmp += day;
	return tmp;
}

Date& Date::operator+=(int day)
{
	_day += day;
	while (_day > getMonthDay(_year, _month))
	{
		_day -= getMonthDay(_year, _month);
		++_month;
		if (_month == 13)
		{
			++_year;
			_month = 1;
		}
	}
	return *this;
}

//Date Date::operator-(int day)
//{
//
//}
//
//Date& Date::operator-=(int day)
//{
//
//}
//
//Date& Date::operator-(const Date& d1)
//{
//
//}
